// 字段设计接口
export interface FieldsComponentPropsInterface {
    filedJsonString: string;
    valueChange: (value: string) => void
}

export interface FieldInterface {
    filed:string;
    name:string;
    size:number;
    
}


// 表单设计接口
export interface OptionInterface {
    key: string;
    value: string;
}

export interface OptionComponentPropsInterface {
    json_string?: string;
    valueChange: (value: string) => void;
}

export interface OptionJsonInterface {
    data: OptionInterface[];
}

export interface DesignInterface {

    design: Array<ControllerMappingInterface>
}


export interface ControllerPropertyInterface {
    id: string;
    name?: string;
    title?: string;
    x?: number;
    y?: number;
    z?: number;
    placeholder?: string;
    option?: string;
    width?: number;
    height?: number;
    backgroundColor?: string;
    type: keyof ControllerMappingInterface;
    handelId?: (id: string) => void;
}

// 左侧容器按钮接口
export interface CommonButtonPropsInterface {
    text: string;
    control: keyof ControllerMappingInterface;
    type: string;
    onComponentCreated?: <Key extends keyof ControllerMappingInterface>(componentProperty: ControllerMappingInterface[Key]) => void;
    handelId?: (id: string) => void;
}

export interface commonButtonCollapseListInterface {
    key: string;
    label: string;
    children: Array<CommonButtonPropsInterface>;
}

// 类型安全映射
export interface ControllerMappingInterface {
    Container: ContainerInterface;
    Input: ContainerInterface;
    Select: ContainerInterface;
    CheckBox: ContainerInterface;
    Number: ContainerInterface;
    DatePicker: ContainerInterface;
    Button: ContainerInterface;
}

export interface DesignJSONInterface {
    data: ControllerMappingInterface[keyof ControllerMappingInterface][];
}

export interface TranslatePropsInterface {
    property: ControllerMappingInterface[keyof ControllerMappingInterface];
}

export interface DesignPropsInterface {
    design: string;
    DesignChange: (design: string) => void;
}

export interface ContainerInterface extends ControllerPropertyInterface {
}
